1. Field of the Invention
This invention relates generally to data processing, and more particularly, to storage and execution of BIOS code in a personal computer.
2. Description of Related Art
All computers, such as the various models of personal computers, or PC""s, produced by IBM Corporation, execute xe2x80x9coperating system softwarexe2x80x9d that instructs the PC on how to use other programs, termed xe2x80x9capplication software,xe2x80x9d such as word processing and spreadsheet programs. Examples of PC operating systems include MS-DOS and WINDOWS, manufactured by Microsoft Corporation, and IBM""s OS/2.
Before a PC can run an operating system, it must load the operating system from a disk to the PC""s working memory which is ordinarily random access semiconductor memory (RAM). This is carried out through a process known as xe2x80x9cbootstrapping,xe2x80x9d or more simply, xe2x80x9cbootingxe2x80x9d the PC. Booting occurs automatically when the PC is first turned on, a process called a xe2x80x9ccold boot,xe2x80x9d or by the user while the computer is running (xe2x80x9cwarm bootxe2x80x9d).
Bootstrapping performs only two functions, the first being to run a power-on self-test, or POST, and the other to search the storage media (floppy diskette or hard disk) for the operating system it will load. These functions are controlled by firmware stored in one or more basic input-output system, or BIOS chips inside the PC.
The POST initializes all the internal hardware and hardware connected to the PC known to it, such as memory, and tests and places the hardware in an operational state. The BIOS program then normally checks drive A of the PC to determine if it contains a formatted floppy disk. If a disk is mounted in the drive, the program searches specific locations on the disk to determine if a valid boot record exists. If the floppy drive is empty, the boot program checks the hard drive C for the system files. In the absence of these files, the BIOS will generate an error message.
After locating a disk with a valid boot record, the BIOS program reads the data stored on the first sector of the disk, and copies that data to specific locations in RAM. This information, found in the same location on every formatted disk, constitutes the DOS boot record. The BIOS then passes control to the boot record which instructs the PC on how to load the two hidden operating system files to RAM (the files named IBMBIO.COM and IBMDOS.COM on IBM computers). After loading other operating system files into RAM to carry out the rest of the boot up sequence, the boot record is no longer needed.
The root directory of the boot disk is next searched for a file created by the user (CONFIG.SYS) and which contains commands instructing the operating system how to handle certain operations such as how many files may be opened at a time, and so-called device drivers which describe the existence and characteristics of hardware devices not recognized by BIOS that may be connected to the PC.
Next loaded from the boot disk into RAM is the file COMMAND.COM which is an operating system file containing, among other functions, fundamental DOS commands used throughout application program execution, and a file named AUTOEXEC.BAT created by the user and containing a series of DOS batch file commands or program names to be executed by the PC each time the computer is turned on. This completes the boot up sequence, and at this point the computer is considered fully booted and ready to be used.
The IBM PC operating environment is depicted in FIG. 1, a map of the first 1M of random access system memory. Within the first 640 Kbyte region of the system memory is stored base BIOS data, such as interrupt vectors and other machine specific operating parameters such as identification of drives and access to them through BIOS INT 13 functions. This is followed in the same region of memory by the operating system, such as DOS, followed by any application programs. Residing in the upper layers of the system memory, above 640K (called xe2x80x9cupper memoryxe2x80x9d) but beneath the 1 Mbyte boundary are video data and firmware based BIOS which is fixed for all applications.
Considering now the BIOS itself in more detail, it is the hardware abstraction layer common to all IBM PC compatible systems. The BIOS consists of code carrying out prescribed functions including converting operating signals developed by an operating system executed by the CPU into electrical signals compatible with devices that are responsive to signals provided by the CPU to the system bus. However, as new features and new industry support are introduced, the BIOS must be supplemented or revised to accommodate them. In addition, the BIOS must remain compatible with the currently very large PC install base.
However, the size of the portion of the read only memory (ROM) resident in a PC for storing BIOS code is limited. As depicted In FIG. 1, the address range 0 through FFFFFh reserves only the 128 Kbytes of RAM above E0000h for BIOS. It is necessary to restrict the size of the BIOS to accommodate that constraint in order to retain architectural compatibility with the PC despite that new industry imperatives, such as Plug and Play, PCI, APM 1.1, Smart Energy System (TM) and others continue to evolve and impose additional BIOS requirements. In view of the 128K boundary defined for BIOS, the existing BIOS ROM is insufficient in size to accommodate the necessary services (features and functions).
Furthermore, during PC operation, it is necessary to load an image of the BIOS into an area of the main memory, called xe2x80x9cshadow memory,xe2x80x9d to increase execution speed. The shadow memory stores a replica or image of the BIOS, and enables execution of BIOS routines much faster than would be possible directly from the BIOS ROM.
BIOS developers have attempted to overcome the 128K BIOS limitation by using such techniques as paging or bank switching memory which uses a ROM larger than 128K. However, paging and other approaches that require a ROM memory of increased size are accompanied by additional hardware requirements, and hence, cost, and in some cases, system performance degradation.
Other attempts to satisfy these requirements have included compressing parts of the BIOS in the ROM and decompressing these parts from the ROM into the shadow RAM area upon boot. These attempts have been limited, however, to compressing only the SETUP and, more recently, the video BIOS area. But the remaining portions of the BIOS code have not been a candidate for compression, among other reasons because there has been no mechanism for compressing large blocks of BIOS including the POST component of the BIOS code, decompressing and then booting successfully.
More particularly, a problem is encountered when considering how to compress and thereafter decompress BIOS code upon system initialization. That is, it has not been determined how to successfully carry out a boot when the ROM is compressed, or how to do so under different boot scenarios, such as (1) cold boot, (2) warm boot or reset of the CPU in real mode (that is, having conventional memory only), and (3) warm boot or reset of the CPU in protect mode (for example, having conventional memory and expanded memory).
Furthermore, decompression of BIOS from the ROM into the shadow memory is relatively slow, increasing the time required for bootstrapping. This slow processing is a property inherent in moving data from ROM for handling by the CPU.
An advantage of the invention is in overcoming the foregoing BIOS limitations while maintaining compatibility with existing PC architecture. Another advantage is in reducing the time required for bootstrapping. A further advantage is in performing BIOS code decompression under different boot sceneries, cold and warm, and upon memory conditions of real and protect.
The invention provides a data processing system comprising a central processing unit (CPU), a system memory for storing data in the form of electrical signals, a first port for receiving an input device generating electrical input signals, and at least one second port for supplying electrical output signals to output devices. The CPU is of a type including a BIOS circuit for carrying out prescribed functions including converting operating signals developed by an operating system executed by the CPU into electrical signals compatible with devices that are responsive to signals provided by the CPU to the system bus. In accordance with an important aspect of the invention, an initial portion of the BIOS code that is required to enable the system memory is in uncompressed form and a remaining portion thereof for carrying out prescribed functions including converting operating signals developed by an operating system executed by the CPU into electrical signals compatible with devices that are responsive to signals provided by the CPU to the system bus, is in compressed form.
In accordance with an aspect of the invention, the portion of the BIOS code that is uncompressed in ROM includes an initial portion of a power on system test (POST) code which is sufficient to enable the system memory, a remaining portion of which is compressed.
To reduce the time required for decompression of BIOS code, the code is transferred from ROM to the system memory in compressed form. Then, after a jump from one location of the system memory to another, decompression of the code takes place.
Upon cold boot, the initial portion POST is read directly from ROM to enable the system memory, and then an image of the entire BIOS code, the major portion of which is in compressed form, is written to RAM in the system memory, and control is transferred to the image. As needed, portions of the BIOS code including POST, Setup (if invoked) and then other BIOS routines are selectively decompressed from the shadow memory to another location of the system memory. Normal execution of POST and BIOS then proceeds until the boot is completed.
Upon a warm boot call, when the processor is in real mode, that is conventional with respect to INTEL 8088 type microprocessors, the procedure is similar but requires a solution to a complication, namely, that whereas the uncompressed POST code in ROM must be executed, the decompressed BIOS is currently mapped into the upper region of the system memory reserved for BIOS (000F0000h-000FFFFFh). Hence, in accordance with a particular aspect of the invention, ROM mapping is modified by carrying out a memory swapping process as follows. System BIOS restarts the system by transferring control to the region of the BIOS image corresponding to power up (000FFFF0h) in shadow RAM. Then, control is transferred to a region lower in the shadow RAM image (000E0000h-000EFFFFFh). The upper region of the image (000F0000h-000FFFFFh) is remapped from shadow RAM to ROM, and control is transferred to that region (in ROM).
On the other hand, upon a warm boot call when the processor is in protect mode, that is, adapted for a system having more than 1 Mbyte of memory when both conventional and expanded memory are enabled, the scenario is complicated upon a reboot call by loading of an EMS (Expanded Memory Specification) emulator or issuance of an BIOS shutdown in the conventional xe2x80x9c286xe2x80x9d or higher system. In accordance with another aspect of the invention, under this scenario, the first instruction executed is identical both in the ROM image and in the decompressed BIOS image. In the preferred embodiment, the instruction at the same location (FFFFFFF0h) is read from ROM, the same as for a cold boot. Unlike cold boot, however, control is then transferred to the ROM image (000F0000h-000FFFFFh) region in the shadow RAM, and warm boot continues as in the scenario. described above for real memory mode. Since control proceeds to the same address in ROM (cold boot) and shadow RAM (warm boot), the instructions at FFFFFFF0h and 000FFFF0h are identical. Hence, BIOS code exists at the target address in both locations.
Still other advantages of the present invention will become readily apparent to those skilled in this art from the following detailed description, wherein only the preferred embodiment of the invention is shown and described, simply by way of illustration of the best mode contemplated of carrying out the invention. As will be realized, the invention is capable of other and different embodiments, and its several details are capable of modifications in various obvious respects, all without departing from the invention. Accordingly, the drawings and description are to be regarded as illustrative in nature, and not as restrictive.